package com.forekenow.demo;

public class demo {
    public static void main(String[] args) {
        //方法调用
        int[] arr = demo.method3();
        for (int i = 0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        //
        int [] a ={3,2,5,5,12,45,6};
        int [] array = demo.sort(a);
        for (int i =0;i<array.length;i++){
            System.out.println(array[i]);
        }
    }
    public static int[] method3(){
        int[] arr  = {1,2,3,4,5,6};
        return arr;
    }

    public static int[] method4(int[] arr){
        return arr;
    }

    public static int[] sort(int[] a){
        int temp = 0;
        for (int i =0 ;i< a.length;i++){
            for (int j =0;j<a.length-i;j++){
                if (a[j]>a[j+1]){
                    temp = a[j];
                    a[j] = a[j+1];
                    a[j+1]= temp;
                }
            }
        }
        return a;
    }
}
